1. Field of the Invention
This invention relates generally to the field of processor operations. More particularly, the invention relates to an apparatus and method for performing vector gather and scatter operations using a computer processor.
2. Description of the Related Art
In order to perform vector computations on a computer, matrices such as that illustrated in FIG. 1 must frequently be loaded into memory. Once in memory, the matrix may be combined with other matrices (not shown) to perform complex, multidimensional computations (e.g., vector addition, vector multiplication).
One problem which exists, however, is that matrices can take up a substantial amount of memory, particularly when used to store certain types of data (e.g., scientific data pertaining to physical phenomenon). In addition, matrices may be sparsely populated with data elements. For example, only 4 data elements out of the 24 illustrated in FIG. 1 contain non-zero values, resulting in an inefficient use of memory.
To conserve memory when working such large, sparsely populated matrices, “gather” and “scatter” operations were developed. For example, the CRAY-1 computer system performed gather operations to collect the elements of a matrix from memory and store them in a highly compressed format (e.g., sorted contiguously in an ordered array). Conversely, when necessary to perform various matrix operations (e.g., matrix multiplication) the CRAY-1 performed scatter operations to reproduce the previously-gathered matrix in memory.
One problem which exists, however, is that these systems require complex dedicated hardware to perform the gather and scatter operations. For example, the CRAY-1 employed a vector processor which performed gather and scatter operations using dedicated registers to hold index vectors and dedicated address calculation hardware.
Accordingly, what is needed is a more efficient apparatus and method for storing and working with matrices in a computing environment. What is also needed is a system and method for performing gather and scatter operations on a general purpose processor.